<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>公告管理</title>
    <link rel="stylesheet" th:href="@{/css/Notice.css}">
    <script src="https://code.jquery.com/jquery-3.6.0.slim.js"></script>
<!--    在导入js之前要导入JQuery配置-->
    <script src="../js/Notice.js"></script>
</head>
<style type="text/css">
</style>
<body>
<div class="wrapper">
    <!--发布公告首页DIV-->
    <div class="index">
        <input type="button" class="button" value="发布公告" onclick="ShowDiv('insert','box1','myDiv1')">
        <button><a id="del" onclick="alldel()" style="color: white; text-decoration:none;">批量删除</a></button>
        <table border="1" class="zhuose" cellspacing="0" >
            <tr>
                <th><input id="checkAll" class="sign" th:type="checkbox"></th>
                <th>ID</th>
                <th>公告内容</th>
                <th>发布时间</th>
                <th>发布人</th>
                <th>操作</th>
            </tr>
            <tr th:each="notice,noticeStat : ${notices}">
                <td><input id="choose" class="checkb" name="selectFlag" th:value="${notice.noticeid}" th:type="CheckBox"></td>
                <td th:text="${notice.noticeid}"></td>
                <td th:text="${notice.noticecontents}"></td>
                <td th:text="${notice.noticedate}"></td>
                <td th:text="${notice.adminname}"></td>
                <td>
                    <button><a th:onclick="Show([[${notice.noticecontents}]])" style="color: white; text-decoration:none;">查看详情</a></button>
                    <button><a th:onclick="ShowAndView([[${notice.noticeid}]],[[${notice.adminid}]],[[${notice.adminname}]],[[${notice.noticecontents}]],[[${#dates.format(notice.noticedate,'yyyy-MM-dd hh:mm:ss')}]])" style="color: white; text-decoration:none;">修改</a></button>
                    <button><a th:href="@{'/delete/'+${notice.noticeid}}" onclick="return delcfm()" style="color: white; text-decoration:none;">删除</a></button>
                </td>
            </tr>
        </table>
        <div>
            <input id="1" class="button1" type="button" value="首页">
            <input id="2" class="button1" type="button" value="上一页">
            <input id="3" class="button1" type="button" value="下一页">
            <input id="4" class="button1" type="button" value="尾页">
        </div>
    </div>


    <!--发布公告DIV-->
    <div id="insert" class="insert">
        <div id="box1" class="black_overlay" style="display: none;">
        </div>
        <div id="myDiv1" class="white_content">
            <div style="text-align: right; cursor: default; height: 40px;">
                <span style="font-size: 16px;" onclick="CloseDiv('insert','box1','myDiv1')">关闭</span>
                <div class="div">
                    <textarea id="content" placeholder="请输入公告内容信息"></textarea>
                    <input id="submit" th:onclick="AddListen()"  type="button" class="button" value="发布">
                </div>
            </div>
        </div>
    </div>

    <!--修改公告-->
    <div id="update" class="update">
        <div id="box3" class="black_overlay" style="display: none;">
        </div>
        <div id="myDiv3" class="white_content">
            <div style="text-align: right; cursor: default; height: 40px;">
                <span style="font-size: 16px;" onclick="CloseDiv('update','box3','myDiv3')">关闭</span>
            </div>
            <div style="text-align: center; cursor: default; height: 40px;">
                <form action="/update" method="post">
                    公告ID：<input id="noticeid1" th:name="noticeid" value="" readonly="readonly"><br>
                    管理员ID：<input id="adminid1" th:name="adminid" value=""  readonly="readonly"><br>
                    管理员姓名：<input id="adminname1" th:name="adminname" value=""  readonly="readonly"><br>
                    公告内容：<input id="contents1" th:name="noticecontents" value="" ><br>
                    公告时间：<input id="date1" th:name="noticedate" value="" readonly="readonly"><br>
                    <button  class="button" type="submit">提交</button>
                </form>
            </div>
        </div>
    </div>

    <!--查看公告详情DIV-->
    <div id="details" class="details">
        <div id="box4" class="black_overlay" style="display: none;">
        </div>
        <div id="myDiv4" class="white_content">
            <div style="text-align: right; cursor: default; height: 40px;">
                <span style="font-size: 16px;" onclick="CloseDiv('details','box4','myDiv4')">关闭</span>
            </div>
            <div style="text-align: center; cursor: default; height: 40px;">
                <textarea id="detail" name="detail" style="width: 80%; height: 80%;" value=" " readonly="readonly" type="text"></textarea>
            </div>
        </div>
    </div>

</div>


</body>
</html>



